#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMainWindow>
#include <QFileDialog>
#include <QFileInfo>
#include <QImage>
#include <QLabel>
#include <QTextCodec>
#include <QMessageBox>
#include <QHBoxLayout>
#include <QScrollArea>
#include "Image.h"
#include<qimage.h>

#define cancel_quantity 40
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void Cancel_Image();

private slots:

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

    void on_actionopen_2_triggered();

    void on_actionsave_2_triggered();

    void on_actiongongn_triggered();

    void on_pushButton_clicked();

    void on_pushButton_5_clicked();

    void on_pushButton_6_clicked();

    void on_pushButton_7_clicked();

    void on_pushButton_8_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_11_clicked();

    void on_pushButton_9_clicked();

    void on_pushButton_10_clicked();

    void on_pushButton_12_clicked();

private:
    Ui::MainWindow *ui;
    unsigned char *mydata;
    Image myimg;
     QImage* img=new QImage;

     int sharpen_valve = 0;//阀门，用来控制撤销功能
     Image sharpen_myimg;
     int sharpenre_valve = 0;
     Image sharpenre_myimg;
     int Grey_scale_valve = 0;
     Image Grey_scale_myimg;

     Image cancel_arr[cancel_quantity];//另一套撤销功能
     int cancel_head=0;//记录最新图像保存在哪个位置
     int cancel_tail=0;//记录最旧的图像位置
     int cancel_p = 0;//记录此时显示的图像位置
};
#endif // MAINWINDOW_H
